{extend name="/fool" /}
{block name="css"}
<link rel="stylesheet" href="/css/admin/user_setting.css">
<style>
    .last{
        text-align: left;
    }
    .tjck{
        background: #fff;
        box-shadow: 0 0 10px 0 rgba(0,0,0,0.5);
        width:300px;
        position: absolute;
        left:50%;
        top:50%;
        margin-top: -300px;
        margin-left: -150px;
        display: none;
    }
    .zilan{
        margin-left: 50px;
    }
</style>
{/block}
{block name="menu_content"}
<div>
    <form class="layui-form" action="" method="post">
        <table>
            <tr>
                <td>使用人：</td>
                <td class="last">
                    <div class="layui-input-inline">
                        <input id="name" value="" type="text" name="name" autocomplete="off" class="layui-input" placeholder="使用人" required>
                    </div>
                </td>
            </tr>
            <tr>
                <td>账号：</td>
                <td class="last">
                    <div class="layui-input-inline">
                        <input id="username" value="" type="text" name="username" autocomplete="off" class="layui-input" placeholder="账号" required>
                    </div>
                </td>
            </tr>
            <tr>
                <td>密码：</td>
                <td class="last">
                    <div class="layui-input-inline">
                        <input id="password" type="password" name="password" autocomplete="off" class="layui-input" placeholder="密码" required>
                    </div>
                </td>
            </tr>
            <tr>
                <td></td>
                <td class="last">
                    <button type="submit" class="save layui-btn layui-btn-normal">保存</button>
                </td>
            </tr>
        </table>
    </form>
</div>
<script>
    $(".save").click(function(){
        var name = $('#name').val();
        var username = $("#username").val();
        var password = $("#password").val();
        console.log(password);
        $.post("{:url('setting')}",{
            name,username,password
        },function(res){console.log(res)},'json');
    })
    $(".saves").click(function(){
        history.go(0);
    })
    $(".add").click(function(){
        $(".tjck").show();
    })
    $(".qx").click(function(){
        $(".tjck").hide();
    })
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });

    "{if isset($success)}"
    layui.use('layer', function(){
        var layer = layui.layer;

        layer.msg("{$success}");
    });
    "{/if}"
</script>
{/block}